/**
 * @description 后台菜单路由
 */
export const menuRoutes = [
  {
    path: '/center',
    name: 'center',
    redirect: '/dashboard',
    component: () => import('@/views/backstage/center.vue'),
    children: [
      {
        path: '/dashboard',
        name: 'dashboard',
        component: () => import('@/views/backstage/dashboard/console.vue'),
        meta: {
          title: '首页',
          icon: 'home_icon_home',
        }
      }, {
        path: '/antired',
        name: 'anti-red',
        component: () => import('@/views/backstage/url/antiRed.vue'),
        meta: {
          title: '防红链接',
          icon: 'home_icon_link'
        }
      }, {
        path: '/domain',
        name: 'domain-manage',
        redirect: '/domain/entry',
        component: () => import('@/views/backstage/domain/domain.vue'),
        meta: {
          title: '域名管理',
          icon: 'home_icon_dns',
          renderChildren: true
        },
        children: [
          {
            path: 'entry',
            name: 'entry-domain',
            component: () => import('@/views/backstage/domain/domain.vue'),
            meta: {
              title: '入口域名',
              type: 0
            },
          }, {
            path: 'landed',
            name: 'landed-domain',
            component: () => import('@/views/backstage/domain/domain.vue'),
            meta: {
              title: '落地域名',
              type: 1
            },
          }, {
            path: 'manage',
            name: 'global-manage',
            component: () => import('@/views/backstage/domain/domain.vue'),
            meta: {
              title: '全局管理',
              type: 2
            }
          }
        ]
      }, {
        path: '/appearance',
        name: 'appearance',
        component: () => import('@/views/backstage/exterior/appearance.vue'),
        meta: {
          title: '外观风格',
          icon: 'home_icon_style'
        }
      }, {
        path: '/account',
        name: 'account',
        component: () => import('@/views/backstage/account/account.vue'),
        meta: {
          title: '子账户',
          icon: 'home_icon_usergroup',
          renderChildren: false
        },
        children: [
          {
            path: ':id',
            name: 'account',
            component: () => import('@/views/backstage/account/information.vue'),
            meta: {
              title: '账户信息',
            },
          }
        ]
      }, {
        path: '/setting',
        name: 'setting',
        component: () => import('@/views/backstage/setup/setting.vue'),
        meta: {
          title: '设置中心',
          icon: 'home_icon_set',
        },
      }
    ]
  }
]

/**
 * @description 后台另外的路由
 */
export const backstageRoutes = [
  {
    path: '/statistics/:id',
    name: 'statistics',
    redirect: {name: 'chart'},
    component: () => import('@/views/backstage/url/statistics.vue'),
    children: [
      {
        path: 'chart',
        name: 'chart',
        component: () => import('@/views/backstage/url/statistics.vue'),
        meta: {
          title: '数据图表'
        }
      },
      {
        path: 'record',
        name: 'record',
        component: () => import('@/views/backstage/url/statistics.vue'),
        meta: {
          title: '访问记录'
        }
      },
      {
        path: 'detection',
        name: 'detection',
        component: () => import('@/views/backstage/url/statistics.vue'),
        meta: {
          title: '域名检测'
        }
      }
    ]
  }
]

/**
 * @description 其他路由
 */
export const exceptionRoutes = [
  {
    path: '/redirect',
    name: 'redirect',
    component: () => import('@/views/exception/redirect.vue'),
    meta: {
      title: '跳转中...'
    }
  }, {
    path: '/:path(.*)*',
    name: '404',
    component: () => import('@/views/exception/404.vue'),
    meta: {
      title: '您访问的页面不存在...'
    },
  }
]
